<!DOCTYPE html>
<html>

<head>
    <title>{$article.post_title}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}" />
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@head" />
</head>

<body class="bg-white page-article">
    <include file="public@nav" />
    <section class="bg-light py-4">
        <div class="container">
            <div class="text-center text-dark">
                <p><span class="badge badge-info">{$category.name}</span></p>
                <h2>{$article.post_title}</h2>
                <div class="article-infobox">
                    <empty name="$article.user.user_nickname">
                        {$article.user.user_login}
                        <else/> {$article.user.user_nickname}
                    </empty>
                    <span>
                        <a href="javascript:;"><i class="fa fa-eye"></i> <span>{$article.post_hits}</span></a>
                    <a href="{:url('portal/Article/doLike',array('id'=>$article['id']))}" class="js-count-btn"><i
                                class="fa fa-thumbs-up"></i> <span class="count">{$article.post_like}</span> </a>
                    <a href="{:url('user/favorite/add')}" class="js-favorite-btn" data-title="{:base64_encode($article.post_title)}" data-url="{:cmf_url_encode('portal/Article/index',array('id'=>$article['id']))}" data-table="portal_post" data-id="{$article['id']}">
                            <i class="fa fa-star-o"></i>
                        </a>
                    </span>
                </div>
            </div>
        </div>
    </section>
    <div class="container my-3">
        <div class="row">
            <div class="col-md-9">
                <div class="tc-box article-box">
                    <div class="media mb-4">
                        <div style="width: 54px;" class="mr-3">
                            <empty name="$article.user.avatar">
                                <img src="/assets/dist/images/headicon_128.png" class="img-fluid rounded-circle" alt="{$article.post_title}">
                                <else/>
                                <img src="{:cmf_get_user_avatar_url($article.user.avatar)}" class="img-fluid rounded-circle" alt="{$article.post_title}">
                            </empty>
                        </div>
                        <div class="media-body">
                            <p class="text-muted">
                                <empty name="$article.user.user_nickname">
                                    {$article.user.user_login}
                                    <else/> {$article.user.user_nickname}
                                </empty> 发布于 {:func_friendly_time($article.published_time)}
                            </p>
                            <h5>{$article.post_title}</h5>
                            <div class="article-content">
                                <div class="text-justify">
                                    {:func_friendly_content($article.post_content)}
                                </div>
                                <notempty name="article.more.photos">
                                    <hr>
                                    <h6 class="">话题图片：</h6>
                                    <br>
                                    <ul id="gallery-slider" class="list-unstyled">
                                        <foreach name="$article.more.photos" item="gallery">
                                            <li class="text-center">
                                                <img src="{:cmf_get_image_url($gallery.url)}" class="img-fluid mb-3" alt="">
                                                <notempty name="gallery.caption">
                                                    <p class="text-left mx-2 text-center">
                                                        {$gallery.caption}
                                                    </p>
                                                </notempty>
                                            </li>
                                        </foreach>
                                    </ul>
                                </notempty>
                            </div>
                        </div>
                    </div>
                </div>
                <section class="bg-light p-3">
                    <h5 class="font-weight-light">评论({$article['comment_count']})</h5>
                    <php>
                        $after_content_hook_param=[ 'object_id'=>$article['id'], 'table_name'=>'portal_post', 'object_title'=>$article['post_title'], 'user_id'=>$article['user_id'], 'url'=>cmf_url_encode('portal/Article/index',array('id'=>$article['id'],'cid'=>$category['id'])), 'object'=>$article ];
                    </php>
                    <hook name="after_content" param="after_content_hook_param" />
                    <php>
                        $comment_hook_param=[ 'object_id'=>$article['id'], 'table_name'=>'portal_post', 'object_title'=>$article['post_title'], 'url'=>cmf_url_encode('portal/Article/index',array('id'=>$article['id'],'cid'=>$category['id'])) ]; $comment=hook_one('comment',$comment_hook_param);
                    </php>
                    <if condition="empty($comment) && cmf_get_current_admin_id()">
                        <div style="border: 1px dashed #ddd;min-height: 200px;padding-top: 50px;">
                            <div class="alert alert-warning" role="alert">
                                此区域这为评论区，请安装评论插件！
                                <br>
                                <em>注：普通用户不会看到此提示！</em>
                            </div>
                        </div>
                    </if>
                    {$comment}
                </section>
            </div>
            <div class="col-md-3">
                <div class="card mb-3">
                    <div class="card-header">
                        热门排行
                    </div>
                    <ul class="list-group list-group-flush">
                        <portal:articles limit="5" order="post.post_hits DESC" categoryIds="">
                            <php>$top=$key
                                <3? "top3": "";</php>
                                    <li class="{$top} list-group-item text-truncate">
                                        <i>{$key+1}</i>
                                        <a title="{$vo.post_title}" href="{:cmf_url('portal/Article/index',array('id'=>$vo['id']))}">
                                   {$vo.post_title}
                                </a>
                                    </li>
                        </portal:articles>
                    </ul>
                </div>
                <div class="card mb-3">
                    <div class="card-body">
                        <div class="text-center">
                            关注微信公众号
                            <br><span class="badge badge-info">新梅陇客栈</span>
                            <img src="/assets/dist/images/qrcode.jpg" class="img-fluid">
                        </div>
                    </div>
                </div>
                <div class="card mb-3">
                    <div class="card-body">
                        <h6 class="">关于社区</h6>
                        <ul class="list-unstyled m-0">
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>40))}">联系我们</a></li>
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>39))}">关于我们</a></li>
                            <li><a href="{:cmf_url('portal/Page/index',array('id'=>39))}">近期活动</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <include file="public@footer" />
    <include file="public@scripts" />
    <hook name="before_body_end" />
</body>

</html>